<?php
require_once '../config/config.php';
require_once '../lib/member.php';
require_once '../lib/user.php';
require_once '../lib/kelas.php';
require_once '../lib/produk.php';

$config=new config();
$config->connect();

session_start();
if (!isset($_SESSION['MM_Username'])){
	$togo="../login.php";
	header ("Location:$togo");
}

if(ISSET($_POST["id"])){
$member=new Member();
echo $_POST["id"];
echo $_POST["status"];

$member->id=$_POST["id"]; 
$member->banned=$_POST["status"];
//var_dump($member);

$Member_Dao=new Member_Dao();
$Member_Dao->banned($member);
//header ("location: daftar_member.php");
echo "<meta http-equiv=\"refresh\" content=\"0;url=daftar_member.php\">";
exit(1);
}

if(ISSET($_GET['id'])){
$Member_Dao=new Member_Dao();
$data=$Member_Dao->get_id($_GET['id']);
}
//var_dump($data);


?>
<?php include("header_admin.php") ?>
<?php include("menu_kiri_admin.php") ?>
<style type="text/css">
<!--
.style1 {
	color: #CC0099;
	font-weight: bold;
	font-size: 24px;
}
.style3 {font-size: 14px}
.style4 {font-size: 16px}
.style5 {color: #990000}
.style6 {font-size: 18px}
-->
</style>



<div id="body">
<div class="topbox">
                  <p align="center" class="style1 style5">Ubah Status Member</p>    
<form id="form1" name="form1" method="post" action="ubah_status.php">
                    <label></label>
      <div align="right"></div>
                    
      <div align="left">
        <table width="200" border="1">
          <tr>
            <td>Nama</td>
            <td>Status</td>
          </tr>
          <tr>
            <td><?php echo $data->nama;?></span></td>
            <td><?php
			if ($data->banned == "0"){
				$checked_blm = "CHECKED";
				$checked_sdh = "";
			} else {
				$checked_blm = "";
				$checked_sdh = "CHECKED";
			}
		?>
		
		<input type="radio" name="status" value="0" <?php echo $checked_blm; ?>> Aktif
		<input type="radio" name="status" value="1" <?php echo $checked_sdh; ?>> Blokir</strong> <br /> </td>
          </tr>
                                </table>
        <p>
          <label>
          <input type="hidden" name="id" value="<?php echo $data->id;?>" />
          <input type="submit" name="Simpan" id="Simpan" value="Simpan" />
          </label>
          <br> 				  
        </p>
      </div>
</form>
    </div> 
</div>
          
         <div class="clear"></div>
         <?php include("../footer.php") ?>
         